package com.sense.kukoo.common.wiget.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.adapter.FragmentViewHolder


/**
@Author Lionszhang
@Date   2021/2/27 14:23
@Name   MainPagerAdapter
@Instruction ViewPager 适配器
 */
class CommonPagerAdapter(
     mActivity: FragmentActivity,
    private val fragments: List<Fragment>) : FragmentStateAdapter(mActivity) {

    override fun getItemCount(): Int {
        return fragments.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragments[position]
    }

    override fun onBindViewHolder(
        holder: FragmentViewHolder,
        position: Int,
        payloads: MutableList<Any>
    ) {
        super.onBindViewHolder(holder, position, payloads)
    }



}